package com.howells.time.base.adapters;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2016.5.8.
 */
public class ViewPagerAdapter extends FragmentStatePagerAdapter {

    List<Fragment> mFragments;

    public ViewPagerAdapter(FragmentManager fm,List Fragments) {
        super(fm);
        mFragments=Fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        String title="";
        switch (position){
            case 0:title="发现";
                break;
            case 1:title="消息";
                break;
        }
        return title;
    }
}
